<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class RecordModel extends Model
{
    //记录本信息
    protected $table = 'record';   //数据表
    protected $pk = 'record_id';  //主键

    protected $schema=[
        'record_id' => 'int',
        'user_id' => 'int',
        'record_title' => 'string',
        'record_content' => 'string',
        'record_authority' => 'int',
        'record_time' => 'datetime',

    ];

    protected $createTime = 'record_time';

    public static function getAllRecordInfo()
    {
        return RecordModel::field('record_id,record_title,record_content,record_authority,record_time')->select();
    }

    public static function getRecordByID($record_id)
    {
        return RecordModel::where('record_id',$record_id)->find();
    }

}
